<?php
$openningTime = strtotime($detail['CourseDetail']['opening_date']);
$closingTime = strtotime($detail['CourseDetail']['closing_date']);
?>
<h1 id="mainTitle" class="schedule">このクラスに参加申し込みをする</h1>
<?php echo $this->Form->create('CourseDetail', array('url' => array('controller' => 'course', 'action' => 'enter'), 'method' => 'POST'));?>
<?php echo $this->Form->hidden('id', array('value' => $detail['CourseDetail']['id']));?>
	<table class="schedule">
		<tr class="first">
			<td class="left">受講コース名</td>
			<td><?php echo $course['Course']['title'];?></td>
		</tr>
		<tr>
			<td class="left">講師名</td>
			<td><?php echo $this->User->getUsername($course);?>&nbsp;</td>
		</tr>
		<tr>
			<td class="left">開始日時</td>
			<td><?php echo date(Configure::read('date_format'), $openningTime);?> ~ <?php echo date(Configure::read('date_format'), $closingTime);?></td>
		</tr>
		<tr>
			<td class="left">エリア</td>
			<td><?php echo $detail['Area']['name'] ? $detail['Area']['name'] : $course['Area']['name'];?></td>
		</tr>
		<tr>
			<td class="left">開催場所</td>
			<td>
				<ul>
					<li>〒<?php echo $detail['CourseDetail']['zip01'];?>&nbsp;-&nbsp;<?php echo $detail['CourseDetail']['zip02'];?></li>
					<li><?php echo $detail['CourseDetail']['address01'];?></li>
					<li><?php echo $detail['CourseDetail']['address02'];?></li>
					<li><?php echo $detail['CourseDetail']['place_name'];?></li>
				</ul>
			</td>
		</tr>
		<tr class="last">
			<td class="left">参加費用</td>
			<td>¥<?php echo $detail['CourseDetail']['price'] ? number_format($detail['CourseDetail']['price']) : $detail['Course']['price'];?></td>
		</tr>
		<tr>
			<td class="paypal" colspan="2">
				<?php echo $this->Html->image('paypal.gif', array('alt' => 'paypal'));?>
				<p class="aboutPaypal">
					お支払いの際には、Paypalをご利用ください。<br />Paypalを利用することで毎回必要なカード番号入力を省略し、スムーズな手続きが可能になります。<br />
					<a href="https://www.paypal.jp/jp/home/" target="">Paypalに登録する</a>
				</p>
			</td>
		</tr>
		<tr>
			<td colspan="2" class="submit">
				<?php if ($joined || $isOwner || $isFull):?>
				<?php echo $this->Form->submit('btn_enter_course_off.png', array('disabled' => 'disabled', 'div' => false));?>
				<?php else:?>
				<?php echo $this->Form->submit('btn_enter_course_off.png', array('div' => false));?>
				<?php endif;?>
				<?php echo $this->Html->link($this->Html->image('btn_cancel_off.png'), $backUrl, array('class' => 'cancelBtn', 'escape' => false));?>
			</td>
		</tr>
	</table>
<?php echo $this->Form->end();?>
<?php echo $this->element('top_link');?>
